package xperiment.metaphor.model.resource;

public class Locale {

	private String language;
	private String country;
	
    private String description;
 
	public Locale() {
		this((String) null, (String) null, (String) null);
	}

	public Locale(java.util.Locale locale) {
		this(locale.getLanguage(), locale.getCountry(), locale.getDisplayName());
	}
	
	public Locale(java.util.Locale locale, String description) {
		this(locale.getLanguage(), locale.getCountry(), description);
	}
	
	public Locale(String language, String country, String description) {
		this.language = language;
		this.country = country;
		this.description = description;
	}

	public Locale(String language, String country) {
		this(language, country, (String) null);
	}
	
	public LocaleKey getKey() {
		return new LocaleKey(language, country);
	}
	
	public void setKey(LocaleKey key) {
		this.language = key.getLanguage();
		this.country = key.getCountry();
	}
	
	public String getLanguage() {
		return this.language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}
	
	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Override
	public String toString() {
		return description;
	}
	
	public Locale[] getAll() {
		return new Locale[] {
			new Locale(java.util.Locale.ENGLISH.getLanguage(), "")
		};
	}
}

